const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('sunnyUserCopy1', {
    id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "主键"
    },
    tenantId: {
      type: DataTypes.STRING(12),
      allowNull: true,
      defaultValue: "000000",
      comment: "租户ID",
      field: 'tenant_id'
    },
    code: {
      type: DataTypes.STRING(12),
      allowNull: true,
      comment: "用户编号"
    },
    userType: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "用户平台",
      field: 'user_type'
    },
    username: {
      type: DataTypes.STRING(45),
      allowNull: true,
      comment: "账号"
    },
    password: {
      type: DataTypes.STRING(45),
      allowNull: true,
      comment: "密码"
    },
    name: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "昵称"
    },
    realName: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "真名",
      field: 'real_name'
    },
    avatar: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "头像"
    },
    email: {
      type: DataTypes.STRING(45),
      allowNull: true,
      comment: "邮箱"
    },
    phone: {
      type: DataTypes.STRING(45),
      allowNull: true,
      comment: "手机"
    },
    birthday: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "生日"
    },
    sex: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "性别"
    },
    roleId: {
      type: DataTypes.STRING(1000),
      allowNull: true,
      comment: "角色id",
      field: 'role_id'
    },
    deptId: {
      type: DataTypes.STRING(1000),
      allowNull: true,
      comment: "部门id",
      field: 'dept_id'
    },
    postId: {
      type: DataTypes.STRING(1000),
      allowNull: true,
      comment: "岗位id",
      field: 'post_id'
    },
    createUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'create_user'
    },
    createDept: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建部门",
      field: 'create_dept'
    },
    createTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "创建时间",
      field: 'create_time'
    },
    updateUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'update_user'
    },
    updateTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'update_time'
    },
    status: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "状态"
    },
    deleteTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "删除时间",
      field: 'delete_time'
    }
  }, {
    sequelize,
    tableName: 'sunny_user_copy1',
    timestamps: true,
    createdAt: 'createTime',
    updatedAt: 'updateTime',
    deletedAt: 'deleteTime',
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
